<html><head><title>CreateCylinder</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">CreateCylinder()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#3A3966"><b>CreateCylinder</b></font>(#Mesh, Radius.f, Height.f [, NbBaseSegments, NbHeightSegments, CloseTop])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Create a new cylinder. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Mesh</i></td>
<td width="90%"> 
The number to identify the new mesh. <a href="../reference/purebasic_objects.html">#PB_Any</a> can be used to 
auto-generate this number. 

</td></tr>
<tr><td><i>Radius</i></td>
<td> 
Radius, in world unit, of the cylinder. 

</td></tr>
<tr><td><i>Height</i></td>
<td> 
Height, in world unit, of the cylinder. 

</td></tr>
<tr><td><i>NbBaseSegments (optional)</i></td>
<td> 
Number of segments used for the base of the cylinder. 

</td></tr>
<tr><td><i>NbHeightSegments (optional)</i></td>
<td> 
Number of segments used for the height of the cylinder. 

</td></tr>
<tr><td><i>CloseTop (optional)</i></td>
<td> 
Specify if the cylinder should be closed on top and bottom, or if it should be left open (like a pipe). Set it to 
<font color="#924B72">#True</font> (default) to create a closed cylinder or to <font color="#924B72">#False</font> else. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Returns nonzero if the mesh was created successfully and zero if there was an error. 
If <font color="#924B72">#PB_Any</font> was used as the #Mesh parameter then the new generated number is returned on success. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2"><font color="#3A3966">  InitEngine3D</font>() 
<font color="#3A3966">  InitSprite</font>() 
  
<font color="#3A3966">  OpenWindow</font>(0, 0, 0, 640, 480, &quot;Cylinder example&quot;, <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#3A3966">  OpenWindowedScreen</font>(<font color="#3A3966">WindowID</font>(0), 0, 0, 640, 480, 0, 0, 0)
  
  <font color="#3A3966">; Light</font>
<font color="#3A3966">  CreateLight</font>(<font color="#924B72">#PB_Any</font>,<font color="#3A3966"> RGB</font>(25, 25, 180), -5, 10, 5, <font color="#924B72">#PB_Light_Point</font>)
  
  <font color="#3A3966">; Camera</font>
<font color="#3A3966">  CreateCamera</font>(0, 0, 0, 100, 100)
<font color="#3A3966">  MoveCamera</font>(0, 2, 1, 3, <font color="#924B72">#PB_Absolute</font> | <font color="#924B72">#PB_Local</font>)
<font color="#3A3966">  CameraLookAt</font>(0, 0, 0, 0)
  
  <font color="#3A3966">; Create the cylinder and attach it to the scene</font>
<font color="#3A3966">  CreateCylinder</font>(0, 0.5, 1)
<font color="#3A3966">  CreateEntity</font>(0,<font color="#3A3966"> MeshID</font>(0), <font color="#924B72">#PB_Material_None</font>)
  
  <b><font color="#3A3966">Repeat</font></b>
<font color="#3A3966">    RenderWorld</font>()
<font color="#3A3966">    FlipBuffers</font>()
  <b><font color="#3A3966">Until</font></b> <font color="#3A3966">WaitWindowEvent</font>(1) = <font color="#924B72">#PB_Event_CloseWindow</font>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="freemesh.html">FreeMesh()</a>, <a href="createsphere.html">CreateSphere()</a>, <a href="createcone.html">CreateCone()</a>, <a href="createmesh.html">CreateMesh()</a>, <a href="createcube.html">CreateCube()</a>, <a href="createplane.html">CreatePlane()</a>, <a href="createline3d.html">CreateLine3D()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=createcube.html>CreateCube()</a> - <a href="index.html">Mesh Index</a> - <a href="createline3d.html">CreateLine3D()</a> -><br><br>

</body></html>